package com.magima.utils;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class ArrayListUtil {
	@SuppressWarnings("unchecked")
	public static <toClass> List<toClass> strArrayToObjArray(List<String> list, Class<?> typeOfT){
		ArrayList<toClass> targetList = new ArrayList<toClass>();
		Gson gson = new GsonBuilder().create();
		for ( String s : list ) {
			targetList.add( (toClass) gson.fromJson(s, typeOfT));
		}
		return targetList;
	}
}
